<!--
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 14:41:20
 * @LastEditTime: 2023-08-31 11:00:35
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description:   :gridOps="gridOptions" other
-->

<template>
	<sc-VxeTable ref="xGrid" :gridEvts="gridEvents" :tablecode="'pro_pot_oqa'" :url="api.pro.pot.oqaList"
		:params="{ is_kk: 1, process_id: { type: 'ni', value: [14] } }">
	</sc-VxeTable>
	<save-oqa v-if="dialog.save" ref="save" @success="handleSuccess" @closed="dialog.save = false"></save-oqa>
</template>

<script>
export default {
	name: "pro_pot_oqa",
};
</script>

<script setup>
import api from "@/api";
import { nextTick, ref } from "vue";
import saveOqa from "./saveOqa";
const dialog = ref({
	save: false,

});
const xGrid = ref({});
const save = ref({});
const handleSuccess = () => {
	xGrid.value.refresh();
};
const edit = (data) => {
	dialog.value.save = true;
	nextTick(() => {
		save.value.setData(data).open();
	});
}

const gridEvents = {
	cellDblclick: function ({ row }) {
		edit(row);
	},
	edit: function ({ button }) {
		edit(button.selectRecords[0]);
	},
};
</script>
